import requests from '../common/request'

export function getAvailablePoints() {
  return requests.get( {
    url: '/memberApp/points/available'
  })
}
export function getPointRule() {
  return requests.get( {
    url: '/memberApp/points/rule'
  })
}
export function getPointGainWay() {
  return requests.get( {
    url: '/memberApp/points/gainWay'
  })
}

export function getPointRecord(data) {
  return requests.get( {
    url: '/memberApp/memberRecords/points/list',
    data: data
  })
}

export function getPointRecordCount(data) {
  return requests.get( {
    url: '/memberApp/memberRecords/points/count',
    data: data
  })
}


// 积分商城
export function queryProductList(data) {
  return requests.post( {
    url: '/mall_mobile/product/list',
    data: data
  })
}

export function getProductDetail(data) {
  return requests.get( {
    url: '/mall_mobile/product/detail',
    data: data
  })
}

export function createOrder(data) {
  return requests.post( {
    url: '/mall_mobile/point_order/create_order',
    data: data
  })
}
export function queryOrderStatus(data) {
  return requests.post( {
    url: '/mall_mobile/point_order/query_status?orderNo=' + data.orderNo
  })
}

export function queryOrderList(data) {
  return requests.post( {
    url: '/mall_mobile/point_order/list',
    data: data
  })
}
export function getOrderDetail(data) {
  return requests.post( {
    url: '/mall_mobile/point_order/detail?orderNo=' + data.orderNo
  })
}
